{% extends "base.html" %}

{% block nav %}
<li class="active">
    <i class="fa fa-user"></i> 报表查询
</li>
{% endblock %}

{% block content %}
	<div class="col-lg-12">
		<div id='message'  style="display:none;">
			出问题了
		</div>
		<div class="col-lg-8">
			<div class="panel panel-default ">
				<div class="panel-heading">按条件查询：使用总数以及月总计费</div>
                    <form action="/cmdb/operation/billing"  method="post">
                        <select name="groupby">
                            <option value="country">国家地区</option>
                            <option value="assets_user">使用方</option>
                            <option value="IDC_type">IDC类型</option>
                            <option value="room_info">机房</option>
                            <option value="business_name ">业务名称</option>
                        </select>
                        <select name="orderby">
                            <option value="servers_used">按使用数排序</option>
                            <option value="billing">按月总计费排序</option>
                        </select>
                        <th>上线时间从：<input type="date" name="upline_start" value="2011-01-01" autocomplete="on" required/></th>
                        <th>到：<input type="date" name="upline_end" value="2018-01-01" autocomplete="on" required/></th>
                        <input type="submit" formenctype="multipart/form-data" value="分组查询"  />
                    </form>
				<div class="panel-body">
					<table class="table table-striped">
					  <thead>
						<tr>
                        <th>国家/地区</th>
						<th>使用方</th>
                        <th>IDC类型</th>
                        <th>机房</th>
                        <th>业务名称</th>
                        <th>在用服务器数</th>
                        <th>月总计费</th>
						</tr>
					  <thead>
					  <tbody>

					  {% if result %}
					  	{% if result['data'] %}
					  		{% for country,assets_user,IDC_type,room_info,business_name,servers_used,billing in result['data'] %}
					  			<tr>
					  			<form id='roomForm' action="/statement/operation/billing" method="POST">
                                  <td>{{ country }}</td>
								  <td class="warning">{{ assets_user }}</td>
                                  <td>{{ IDC_type }}</td>
                                  <td class="warning">{{ room_info }}</td>
                                  <td class="danger">{{ business_name }}</td>
                                  <td>{{ servers_used }}</td>
                                  <td class="danger">{{ billing }}</td>
								</form>
								</tr>
					  		{% endfor %}
					  	{% endif %}
					  {% endif %}

					  </tbody>
					</table>
				</div>
			</div>
		</div>
	</div>
{% endblock %}
